// 引入koa
import Koa from 'koa'
// 引入初始化方法
import initCore from './core/Init'
import http from 'http'
import Config from './config/Config'
// 创建koa实例
const app = new Koa()
// 创建服务器
const server: http.Server = new http.Server(app.callback())
// 执行初始化
initCore(app, server)
// 监听端口
app.listen(Config.http_port, () => {
  console.log('run success')
  console.log(`app started at port ${Config.http_port}...`)
})
server.setTimeout(0)
